package com.zt.chatgpt.weixin.service.vaildate;

import com.zt.chatgpt.types.sdk.wexin.util.SignatureUtil;
import com.zt.chatgpt.weixin.service.IWeiXinValidateService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @author: zt
 * @Description: TODO
 * @create: 2024-05-18 23:39
 */

@Service
public class WeiXinValidateService implements IWeiXinValidateService {

    @Value("${wx.config.token}")
    private String token;

    @Override
    public boolean checkSign(String signature, String timestamp, String nonce) {
        return SignatureUtil.check(token, signature, timestamp, nonce);
    }
}
